{include file="public/header" /}
<body class="gray-bg">
    <div class="wrapper wrapper-content">

             <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                       <button type="button" class="btn btn-primary btn-outline" onclick="func1()" >添加模板</button> 
                       <button type="button" class="btn btn-primary btn-outline" onclick="func2()" >发送注册短信</button> 
                    </div>
                    <div class="ibox-content">

                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                    <th class="text-center">应用场景</th>
									<th class="text-center">短信签名</th>
									<th class="text-center">模板ID</th>
									<th class="text-center">模板参数</th>
									<th class="text-center">更新时间</th>
									<th class="text-center">操作</th>
                                </tr>
                            </thead>
                           {foreach name="list" item="vo"}
							<tr>
								<td>
									{$vo.title}
								</td>
								<td class="text-center">{$vo.sign_name}</td>
								<td class="text-center">{$vo.tid}</td>
								<td class="text-center">{$vo.params}</td>
								<td class="text-center">{$vo.update_time}</td>
								<td class="text-center">
									 <a href="{:url('update',['id'=>$vo.id])}" class="btn btn-primary btn-outline btn-xs">
                                                <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                            <a href="javascript:;" onclick="del({$vo.id})" class="btn btn-danger btn-outline btn-xs">
                                                <i class="fa fa-trash-o"></i> 删除</a>  
								</td>
							</tr>
							{/foreach}
                            </tbody>
                        </table>
	{$list->render()}
                    </div>
                </div>
            </div>
        </div>
    </div>
{include file="public/footer" /}
</body>


<script type="text/javascript">

function func1(){
	window.location.href="{:url('add')}";
}

function func2(){
	window.location.href="{:url('fas')}";
}

/**
 * [del 删除]
 * @param   {[type]}    id 
 */
function del(id){
    layer.confirm('确认删除此用户?', {icon: 3, title:'提示'}, function(index){
        //do something
        $.getJSON('./del', {'id' : id}, function(res){
            if(res.code == 200){
                layer.msg(res.msg,{icon:1,time:1500,shade: 0.1},function(index){
                    window.location.href="{:url('index')}";
                });
               
            }else{
                layer.msg(res.msg,{icon:0,time:1500,shade: 0.1});
            }
        });

        layer.close(index);
    })

}
</script>
</html>